From 400b9ac75260da13e4893d92ad214fd99f340385 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sun, 1 Jan 2006 22:07:14 +0000 Subject: [PATCH] $wgOut->setRevisionId() was missing from one branch out of 4, causing an incorrect edit link when editing an old revision which is a redirect. Moved the call outside the if structure. --- includes/Article.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index ae767c5d85..63b7f5aa55 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -833,13 +833,13 @@ class Article { * trigger when the parser cache is used. */ wfRunHooks( 'ArticleViewHeader', array( &$this ) ) ; + $wgOut->setRevisionId( $this->getRevIdFetched() ); # wrap user css and user js in pre and don't parse # XXX: use $this->mTitle->usCssJsSubpage() when php is fixed/ a workaround is found if ( $this->mTitle->getNamespace() == NS_USER && preg_match('/\\/[\\w]+\\.(css|js)$/', $this->mTitle->getDBkey()) ) { - $wgOut->setRevisionId( $this->getRevIdFetched() ); $wgOut->addWikiText( wfMsg('clearyourcache')); $wgOut->addHTML( '
'.htmlspecialchars($this->mContent)."\n
" ); } else if ( $rt = Title::newFromRedirect( $text ) ) { @@ -860,7 +860,6 @@ class Article { $wgOut->addParserOutputNoText( $parseout ); } else if ( $pcache ) { # Display content and save to parser cache - $wgOut->setRevisionId( $this->getRevIdFetched() ); $wgOut->addPrimaryWikiText( $text, $this ); } else { # Display content, don't attempt to save to parser cache @@ -869,7 +868,6 @@ class Article { if( !$this->isCurrent() ) { $oldEditSectionSetting = $wgOut->mParserOptions->setEditSection( false ); } - $wgOut->setRevisionId( $this->getRevIdFetched() ); $wgOut->addWikiText( $text ); if( !$this->isCurrent() ) { -- 2.20.1